<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">

    </div>
</body>
<script src="../react@17.js"></script>
<script src="../react-dom@17.js"></script>
<script src="../babel.js"></script>
<script type="text/babel">
    let sex = true;
    let age = 20;
    let phone='1110000';
    let job = [1,2,3,4,5]
    //jsx 在绑定数据时可以直接绑定变量 页面在{}中编写表达式
    let ol = (
        <ol>
            <li>性别：{sex?'男':'女'}</li>
            <li>年龄：{age>18?'成年':"未成年"}</li>
            <li>联系方式：{phone.replaceAll("0","1")}</li>
            <li>{job.splice(0,2)}</li>
            <li></li>
        </ol>
    )
    ReactDOM.render(ol,document.getElementById("root"))
</script>
</html>